<template>
	<div class="association">
		<el-row>
			<el-col :span="8" v-for="(item, index) in list" :key="index">
				<el-card shadow="hover">
					<div @click="goPage(item)">
						<span>{{ item.dictNameResult.memsubInfoTypeCode }}</span>
						<el-button style="float: right; padding: 3px 0" type="text">
						{{item.countNum}}</el-button>
					</div>

				</el-card>
			</el-col>
		</el-row>
		<div class="center">
			<el-button v-blur class="query" @click="back">关闭</el-button>
		</div>
	</div>
</template>

<script>
import api from '@/api/home/home.js'
export default {
	name: 'association',
	data() {
		return {
			list: [],
		}
	},
	mounted() {
		this.getList();
	},
	activated(){
		if(sessionStorage.getItem('isBack')==='true'){
			sessionStorage.setItem('isBack','false');
			this.getList();
		}
	},
	methods: {
		back() {
			this.$sendEvent('router', { resourceUrl: '/association',type:'del'})
			sessionStorage.setItem('isBack','true');
		},
		getList() {
			//  const loading = this.$loading({
			// 	lock: true,
			// 	text: 'Loading',
			// 	spinner: 'el-icon-loading',
			// 	background: 'rgba(0, 0, 0, 0.7)'
			// });
			let orgTypeCode = sessionStorage.getItem('orgTypeCode');
			api.auditSecToDoFunctionList(this.$route.params.infsubAuditStatusCode, orgTypeCode).then(res => {
				if (res.data && res.data.code == 200) {
					if (res.data.data) this.list = res.data.data;
					// loading.close();
				}
			})
		},
		goPage(item) {
			let orgCode = sessionStorage.getItem('userId');
			let orgTypeCode = sessionStorage.getItem('orgTypeCode');
			const obj1 = {
				'01':'holderInfo2',
				'02':'holderInfo',
				'03':'holderInfo',
			}
			const obj = {
				'01': 'fileRegInfoSecurities',
				'02': 'quaInfo',
				'03': obj1[orgTypeCode]||'holderInfo1',
				'05': 'fileMMenRepresentative',
				'06': 'memContact',
				'07': orgTypeCode == '01' || orgTypeCode == '02' ? 'seniorInfo2' : 'seniorInfo',
				'08': 'branchOffice',
				'09': 'business',
				'11': 'awardInfo',
				'12': 'punishInfo',
				'17': 'practitioner',
				'18': orgTypeCode == '02' ? 'fileActualControllers' : 'actualController',
				'21': 'internalControl',
				'22': 'busSystem',
				'23': 'projectInfo',
				'24': 'companyReport',
				'25': 'qualityStatistics',
				'26': 'compInspection',
				'27': 'announcement',
				'28': 'businessData',
				'29': 'fileDirector',
				'30': 'subsidiary',
				'31': 'periodicReport',
				'32': 'selfReport',
				'33': 'annualReports',
				'34': 'fileRegInfoSecurities1',
				'35': 'holderInfo1',
				'36': 'fileRegInfoSecurities',
				'37': 'quaInfoSecurities',
				'38': 'administrator',
			};
			let menu = obj[item.memsubInfoTypeCode]
			console.log(menu, 'set')
			sessionStorage.setItem('menu', menu);
			// this.$router.push(`/archivesInfo?id=${orgCode}&code=${orgTypeCode}&text=2`)
			this.$router.push(`/archivesInfo?id=${orgCode}&code=orgTypeCode&text=2`)
			this.$sendEvent('router', {
				menuName: '会员信息报送',
				// resourceUrl: `/archivesInfo?id=${orgCode}&code=${orgTypeCode}&text=2`
				resourceUrl: `/archivesInfo?id=${orgCode}&code=orgTypeCode&text=2`
			})
		},
	}
}
</script>

<style scoped lang="scss">
.welcome {
	text-align: left;
}

/deep/.el-card {
	margin: 10px;
	background: #EBF2FF;
	cursor: pointer;
	border: 0;
}
</style>

